import {
    AppstoreOutlined,
    CloudSyncOutlined, DatabaseOutlined,
    HistoryOutlined,
    HomeOutlined, MenuOutlined, NotificationOutlined,
    TeamOutlined, TransactionOutlined,
    UserOutlined, WalletOutlined,
} from "@ant-design/icons-vue";
import type {RouteRecordRaw} from 'vue-router';

export default [
    {
        path: '/admin',
        name: 'adminInfo',
        component: () => import('@/views/admin/index/index.vue'),
        meta: {
            title: '组织详情',
            requiresAuth: true,
            icon: HomeOutlined,
            permission: 'organization',
            actions: ['organization:update','organization:delete'],
        }
    },
    {
        path: '/admin/notice',
        name: 'adminNotice',
        component: () => import('@/views/admin/notice/index.vue'),
        meta: {
            title: '通知公告',
            requiresAuth: true,
            icon: NotificationOutlined,
            permission: 'notice',
            actions: ['notice:create','notice:update','notice:delete']
        }
    },
    {
        path: '/admin/member',
        name: 'PermissionMember',
        component: () => import('@/views/admin/permission/member.vue'),
        meta: {
            title: '成员管理',
            requiresAuth: true,
            icon: TeamOutlined,
            permission: 'member',
            actions: ['member:create','member:update','member:delete']
        }
    },
    {
        path: '/admin/role',
        name: 'PermissionRole',
        component: () => import('@/views/admin/permission/role.vue'),
        meta: {
            title: '角色管理',
            requiresAuth: true,
            icon: UserOutlined,
            permission: 'role',
            actions: ['role:create','role:update','role:delete']
        }
    },
    {
        path:'/admin/permission',
        name: 'Permission',
        meta: {
            title: '权限菜单',
            icon:MenuOutlined,
            requiresAuth: true,
            permission: 'permission'
        },
        component: () => import('@/views/admin/permission/index.vue'),
    },
    {
        path: '/admin/config',
        name: 'adminConfig',
        meta: {title: '应用设置'},
        children: [
            {
                path: '/admin/finance/account',
                name: 'adminFinance',
                component: () => import('@/views/admin/finance/index.vue'),
                meta: {
                    title: '账户设置',
                    requiresAuth: true,
                    icon: WalletOutlined,
                    permission: 'account',
                    actions: ['account:create','account:update','account:delete']
                },
            },
            {
                path: '/admin/finance/payment',
                name: 'adminPayment',
                component: () => import('@/views/admin/finance/payment.vue'),
                meta: {
                    title: '支付方式',
                    requiresAuth: true,
                    icon: TransactionOutlined,
                    permission: 'payment',
                    actions: ['payment:create','payment:update','payment:delete']
                }
            },
            {
                path: '/admin/category',
                name: 'adminCategory',
                component: () => import('@/views/admin/category/index.vue'),
                meta: {
                    title: '分类设置',
                    requiresAuth: true,
                    icon: AppstoreOutlined,
                    permission: 'category',
                    actions: ['category:create','category:update','category:delete']
                }
            },
            {
                path: '/admin/dictionary',
                name: 'adminDictionary',
                component: () => import('@/views/admin/dictionary/index.vue'),
                meta: {
                    title: '数据字典',
                    requiresAuth: true,
                    icon: DatabaseOutlined,
                    permission: 'dictionary',
                    actions: ['dictionary:create','dictionary:update','dictionary:delete']
                }
            },
        ]
    },
    {
        path: '/admin/other',
        name: 'adminOther',
        meta: {title: '其他设置'},
        children:[
            {
                path: '/admin/storage',
                name: 'adminStorage',
                component: () => import('@/views/admin/storage.vue'),
                meta: {
                    title: '存储设置',
                    requiresAuth: true,
                    icon: CloudSyncOutlined,
                    permission: 'storage',
                    actions: ['storage:update']
                },
            },
            {
                path: '/admin/record',
                name: 'SafetyLogs',
                component: () => import('@/views/admin/record.vue'),
                meta: {
                    title: '操作日志',
                    requiresAuth: true,
                    permission: 'record',
                    icon: HistoryOutlined
                }
            }
        ]
    }
] as RouteRecordRaw[];